using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;

namespace LogParser.Collections
{
    public class PointValueList
    {

        #region Private Member Variables

        private DA.PointValuesModel _model;

        private Hashtable _pointValueList;

        #endregion

        #region Public Member Variables

        #endregion

        #region Constructor

        public PointValueList()
        {
            Initialize();
        }

        private void Initialize()
        {
            _model = new LogParser.DA.PointValuesModel();
            _pointValueList = new Hashtable();

            List<GameObjects.PointValue> pointValueList = _model.GetPointValuesList();

            foreach ( GameObjects.PointValue tempPointValue in pointValueList )
            {
                _pointValueList.Add( tempPointValue.ShortName, tempPointValue );
            }

        }

        #endregion

        #region Public Properties

        public int Count
        {
            get
            {
                return _pointValueList.Count;
            }
        }

        #endregion

        #region Private Properties
        #endregion

        #region Public Methods

        public double GetPointValue( string pointValueName )
        {
            GameObjects.PointValue returnPointValue = new LogParser.GameObjects.PointValue();

            try
            {
                returnPointValue = (LogParser.GameObjects.PointValue) ( _pointValueList[ pointValueName ] );
            }
            catch ( Exception ex )
            {
                returnPointValue.Value = -999.0;
            }

            return returnPointValue.Value;

        }

        public double GetKillPoints( int killCount )
        {
            return ( killCount * GetPointValue( "kill" ) );
        }

        public double GetKillAssistPoints( int killassistCount )
        {
            return ( killassistCount * GetPointValue( "killassist" ) );
        }

        public double GetCapturePoints( int captureCount )
        {
            return ( captureCount * GetPointValue( "capture" ) );
        }

        public double GetDefensePoints( int defenseCount )
        {
            return ( defenseCount * GetPointValue( "defense" ) );
        }

        public double GetDestructionPoints( int destructionCount )
        {
            return ( destructionCount * GetPointValue( "destruction" ) );
        }

        public double GetRevengePoints( int revengeCount )
        {
            return ( revengeCount * GetPointValue( "revenge" ) );
        }

        public double GetBuiltObjectPoints( int builtobjectCount )
        {
            return ( builtobjectCount * GetPointValue( "builtobject" ) );
        }

        public double GetHealingPoints( int healingCount )
        {
            return ( healingCount * GetPointValue( "healing" ) );
        }

        public double GetChargeDeployedPoints( int chargedeployedCount )
        {
            return ( chargedeployedCount * GetPointValue( "chargedeployed" ) );
        }

        public double GetHeadshotPoints( int headshotCount )
        {
            return ( headshotCount * GetPointValue( "headshot" ) );
        }

        public double GetBackstabPoints( int backstabCount )
        {
            return ( backstabCount * GetPointValue( "backstab" ) );
        }



        #endregion

        #region Private Methods
        #endregion

    }
}
